//
//  TYTabPagerController.h
//  TYPagerControllerDemo
//
//  Created by tanyang on 16/5/3.
//  Copyright © 2016年 tanyang. All rights reserved.
//

#import "TYPagerController.h"

@class TYTabPagerController;

@protocol TYTabPagerControllerDelegate <TYPagerControllerDelegate>

@optional
// configre collectionview cell
- (void)pagerController:(TYTabPagerController *)pagerController configreCell:(UICollectionViewCell *)cell forItemTitle:(NSString *)title atIndexPath:(NSIndexPath *)indexPath;

// did select indexPath
- (void)pagerController:(TYTabPagerController *)pagerController didSelectAtIndexPath:(NSIndexPath *)indexPath;

// transition frome cell to cell with animated
- (void)pagerController:(TYTabPagerController *)pagerController transitionFromeCell:(UICollectionViewCell *)fromCell toCell:(UICollectionViewCell *)toCell animated:(BOOL)animated;

// transition frome cell to cell with progress
- (void)pagerController:(TYTabPagerController *)pagerController transitionFromeCell:(UICollectionViewCell *)fromCell toCell:(UICollectionViewCell *)toCell progress:(CGFloat)progress;

@end

typedef NS_ENUM(NSUInteger, TYPagerBarStyle) {
    TYPagerBarStyleNoneView, // 无
    TYPagerBarStyleProgressView, // 正常下划线滑动
    TYPagerBarStyleProgressBounceView, // 下划线贪吃蛇效果
    TYPagerBarStyleCoverView, // 圆角背景效果
};

// lxin
typedef NS_ENUM(NSUInteger, TYpagerBarAlignment) {
    TYpagerBarAlignmentDefault, // 默认
    TYpagerBarAlignmentCenter, // 居中
    TYpagerBarAlignmentLeft, // 靠左
    TYpagerBarAlignmentRight // 靠右
};

@interface TYTabPagerController : TYPagerController

#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wobjc-property-synthesis"
@property (nonatomic, weak) id<TYTabPagerControllerDelegate> delegate;
#pragma clang diagnostic pop

// view ,don't change frame
@property (nonatomic, strong, readonly) UIView *pagerBarView; // pagerBarView height is contentTopEdging
@property (nonatomic, weak, readonly) UICollectionView *collectionViewBar;
@property (nonatomic, weak, readonly) UIView *progressView;

@property (nonatomic, assign) BOOL isSeparatePagerBar;

@property (nonatomic, assign) TYPagerBarStyle barStyle; // you can set or ovrride barStyle

@property (nonatomic, assign) CGFloat collectionLayoutEdging; // collectionLayout left right edging

// progress view
@property (nonatomic, assign) CGFloat progressHeight;
@property (nonatomic, assign) CGFloat progressEdging; // if < 0 width + edge ,if >0 width - edge
@property (nonatomic, assign) CGFloat progressWidth; //if>0 progress width is equal,else progress width is cell width

// cell
@property (nonatomic, assign) CGFloat cellWidth; // if>0 cells width is equal,else if=0 cell will caculate all titles width
@property (nonatomic, assign) CGFloat cellSpacing; // cell space
@property (nonatomic, assign) CGFloat cellEdging;  // cell left right edge

//   animate duration
@property (nonatomic, assign) CGFloat animateDuration;

// text font
@property (nonatomic, strong) UIFont *normalTextFont;
@property (nonatomic, strong) UIFont *selectedTextFont;

// if you custom cell ,you must register cell
- (void)registerCellClass:(Class)cellClass isContainXib:(BOOL)isContainXib;

// lxin
@property (nonatomic, assign) TYpagerBarAlignment barAlignment;
@property (nonatomic, strong) NSArray *pagerTitleArr;

@property (nonatomic, assign, readonly) CGFloat pagerTitleWidth; // it works only pagerTitleArr had set.
@property (nonatomic, assign, readonly) CGFloat titleWidth; // it works only pagerTitleArr had set.

@property (nonatomic, assign) BOOL isShowFlag;
@property (nonatomic, assign) BOOL isHideSepLine;
@property (nonatomic, assign) BOOL isHideUnderLine;

@property (nonatomic, strong) UIImage *backgroundImage;

@property (nonatomic, assign) CGFloat collectionViewBarWidth;

//yyd
@property (nonatomic, assign) BOOL isHoveMask;
@property (nonatomic, strong) UIImageView *leftMaskImageView;
@property (nonatomic, strong) UIImageView *rightMaskImageView;

@end

